package com.puhui.education.fragment.main;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.puhui.education.R;
import com.puhui.education.fragment.BaseFrag;
import com.puhui.education.util.SpannableUtil;

import butterknife.Bind;
import butterknife.ButterKnife;

/**
 * Created by Administrator on 2016/5/28.
 */
public class ShoppingCartFrag extends BaseFrag {
    @Bind(R.id.tv_total_shoppingCartFrag)
    TextView textView;
    private Activity activity;
    private View view;
    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        if (view == null) {
            view = inflater.inflate(R.layout.frag_shopping_cart, null);
        }
        ButterKnife.bind(this,view);
        initData();
        return view;
    }

    @Override
    public void onAttach(Context context) {
        super.onAttach(context);
        activity = (Activity) context;

    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        ButterKnife.unbind(this);
    }

    @Override
    protected void initData() {
        super.initData();
        textView.setText(SpannableUtil.createSpannable("合计：¥320",3,7,40,R.color.red));
    }
}
